


from torch import nn
from torch import tensor
from model import make_model
from utils import get_key_padding_mask
from utils import get_subsequent_mask


#实战：使用nn.Transformer实现一个简单的Copy任务
# 任务描述：让Transformer预测输入。例如，输入为[0, 3, 4, 6, 7, 1, 2, 2]，
# 期望的输出为[0, 3, 4, 6, 7, 1]。
# def generate_random_batch(batch_size:int,max_len:int=16):
    

model = make_model(10,10,d_model=16,d_ff=128,h=4)
src = tensor([[0,3,4,6,7,1,2,2]])
tgt = tensor([[0,3,4,6,7,1]])
tgt_mask = get_subsequent_mask(tgt.size(-1))
